<#import './common.ftl' as com>
<@com.page title="登录" bodyBGColor="darkcyan">
    <div>
        <div style="display: flex; justify-content: center;align-content: center;margin-top: 100px;">
            <img src="img/logo.png"  width="200" height="100"/>
        </div>
        <form role='form' style="padding-top: 100px;" class="top form-horizontal">
            <div class="form-group" style="display: flex;">
                <label class="control-label col-md-4" for="account">账号:</label>
                <div class=" col-md-4 ">
                    <input type="text" id="account" class="form-control " />
                </div>
            </div>
            <div class="form-group" style="display: flex;">
                <label class="col-md-4 control-label" for="password">密码:</label>
                <div class="col-md-4"">
                <input type="password" class="form-control" id="password"/>
            </div>
    </div>
			<div class="form-group" style="display: flex;">

                <div class="col-md-offset-4 col-md-2">
                    <div class="checkbox">
                        <label>
                            <input id="remember" type="checkbox" />记住密码
                        </label>
                    </div>

                </div>
                <div class="col-md-2">
                    <a href="./register">
                        <label class="control-label col-md-12" style="text-align: end;padding-right: 0;color: red;">注册账号</label>
                    </a>
                </div>
            </div>
			<div class="form-group" style="margin-top: 100px;">
                <div class="col-md-offset-4 col-md-4">
                    <button id="commit" class=" center-block btn-primary" type="button" style="font-size: 20px;text-shadow: black 5px 3px 3px;">
                        <span class="glyphicon glyphicon-send"></span> 登录
                    </button>
                </div>
            </div>

		</form>
	</div>
</@com.page>

<style>
	.head{
		
	}
</style>
<script>
			$(document).ready(()=>{
				$('#commit').click(()=>{
					var counter=$('#account').val()
					var password=$('#password').val()
				jsJson().postrequest('/login',{
						'accont':counter,
						'password':password,
					},event=>{
				        if (event.code==200){
                            window.location.href='./home'
                        }
					})
				})
			})
</script>